#pragma once

#include <memory>
#include "Containers/Containers.h"
#include "ScriptCompiler/Description/IdentifierDescription.h"
#include "DecoratedTypeDescription.h"

class CPropertyNode;
class CDecoratorDescription;
class CFunctionDescription;
class CParameterDescription;

class CPropertyDescription : public IIdentifierDescription
{
public:

    virtual EIdentifierType GetIdentifierType() const override
    {
        return EIdentifierType::Property;
    }

    std::weak_ptr<CTypeDescription> ParentClass;
    TVector<CString> ParentScopeNameChain;
    CString Name;

    SDecoratedTypeDescription Type;

    std::shared_ptr<CDecoratorDescription> Decorator;


    std::shared_ptr<CPropertyNode> Node;

    virtual CString GetSearchName() const override
    {
        return Name;
    }

    bool IsIndexer()
    {
        return IndexerParameters.Num() > 0;
    }

    TVector<std::shared_ptr<CParameterDescription>> IndexerParameters;
    std::shared_ptr<CFunctionDescription> Getter;
    std::shared_ptr<CFunctionDescription> Setter;

};